Sub ColorPartOfText()
    Dim ws As Worksheet
    Dim cell As Range
    Dim lastRow As Long
    Dim regEx As Object
    Dim matches As Object
    Dim match As Variant

    ' 정규표현식 객체 생성
    Set regEx = CreateObject("VBScript.RegExp")

    regEx.Global = True
    regEx.IgnoreCase = True

    ' "실속미" 또는 "프리미엄미" 찾기
    regEx.Pattern = "(실속\d+미|프리미엄\d+미)"

    ' 시트 이름을 설정하세요 (여기서는 "주문내역"으로 가정)
    Set ws = ThisWorkbook.Sheets("주문내역")

    ' A열의 마지막 행을 찾습니다.
    lastRow = ws.Cells(ws.Rows.Count, 1).End(xlUp).Row

    ' A열의 각 셀을 검사합니다.
    For Each cell In ws.Range("A1:A" & lastRow)
        If regEx.Test(cell.Value) Then
            Set matches = regEx.Execute(cell.Value)
            For Each match In matches
                startPos = InStr(cell.Value, match.Value)
                textLength = Len(match.Value)
                With cell.Characters(Start:=startPos, Length:=textLength).Font
                    .Color = RGB(255, 0, 0) ' 빨간색
                End With
            Next match
        End If
    Next cell
End Sub